package com.kotlin.day01

import org.junit.Test

class Test04Fun {
    @Test
    fun test01() {
        val result = doSomething(18, "张三")
        println(result)//姓名为:二狗子,年龄为:20
        val result1 = doSomething()
        println(result1)//姓名为:二狗子,年龄为:20
        val result2 = doSomething(name = "李四")
        println(result2)//姓名为:李四,年龄为:20
        val result3 = person("jack", 21)
        println(result3)//姓名为:jack,年龄为:21
        MyJava.`is`()//hello is
    }

    private fun doSomething(age: Int = 20, name: String = "二狗子"): String {
        return "姓名为:${name},年龄为:${age}"
    }

    //unit函数 即没有返回值的函数
    private fun person(name: String, age: Int) {
        println("姓名为:${name},年龄为:${age}")
    }
}